﻿using AutofacProject.Entity;
using AutofacProject.Repository.Interface;
using AutofacProject.Service.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutofacProject.Service
{
    public class StudentService : IStudentService
    {

        private readonly IStudentRepository _studentRepository;

        public StudentService(IStudentRepository studentRepository)
        {
            _studentRepository = studentRepository;
        }
        public bool Delete(Student student)
        {
            return _studentRepository.Delete(student);
        }

        public IQueryable<Student> GetList()
        {
            return _studentRepository.GetList();
        }

        public Student GetModel(int Id)
        {
            return _studentRepository.GetModel(Id);
        }

        public int Insert(Student student)
        {
            return _studentRepository.Insert(student);
        }

        public bool Update(Student student)
        {
            return _studentRepository.Update(student);
        }
    }
}
